<!--月度工伤报表 injurySafeRpt-->
<template>
    <Layout>
        <Form ref="queryForm" :model="dataToQuery" :label-width="120">
            <Row class="query-form">
                <Col span="8">
                    <FormItem label="二级集团：">
                        <two-level-org org-code class="query-form-el" v-model="dataToQuery.twoLevelOrgCode" />
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="企业名称：" prop="order">
                        <company-select v-model="dataToQuery.companyName" style="width:100%" />
                        <!-- <cascader-dom class="query-form-el" ref='queryOrgCascader' @setOrgname='setQueryOrgName'
                                      :orgTree="true"
                                      :setCurrentName="{label:dataToQuery.companyName,value:dataToQuery.companyId}"></cascader-dom> -->
                    </FormItem>
                </Col>
                <Col v-if="!switchFlag"  span="8">
                    <Button @click="switchQuery(true, 88)" class="ivu-btn-switch" type="text">展开∨</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button type="primary" class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
                <Col v-else span="8">
                    <FormItem label="人员姓名：" prop="victimName">
                        <Input v-model='dataToQuery.victimName' class="query-form-el"></Input>
                    </FormItem>
                </Col>
                
            </Row>
            <Row v-show="switchFlag" class="query-form">
                <Col span="8">
                    <FormItem label="就业类型：" prop="jobTypeArrs">
                        <Select class='query-form-el' placeholder="请选择就业类型"
                                v-model='dataToQuery.jobTypeArrs' multiple :max-tag-count="2">
                            <Option v-for="item in dictMap['MEM-000001']" :value="item.codingCodeId"
                                    :key="item.codingCodeId">{{ item.codingName }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="伤害程度：" prop="injuryDegreeArrs">
                        <Select class='query-form-el' placeholder="请选择伤害程度" v-model='dataToQuery.injuryDegreeArrs'
                                multiple :max-tag-count="1">
                            <Option v-for="item in dictMap['1000001019']" :value="item.codingCodeId"
                                    :key="item.codingCodeId">{{ item.codingName }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="事故类别：" prop="accTypeArrs">
                        <Select class='query-form-el' placeholder="请选择事故类别"
                                v-model='dataToQuery.accTypeArrs' multiple :max-tag-count="2">
                            <Option v-for="item in dictMap['ACC-000001']" :value="item.codingCodeId"
                                    :key="item.codingCodeId">{{ item.codingName }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
            </Row>
            <Row v-show="switchFlag" class="query-form">
                <Col span="8">
                    <FormItem label='伤残等级：'>
                        <Select class='w' placeholder="请选择伤残等级" v-model='dataToQuery.injuryLevelArrs'  multiple :max-tag-count="2">
                            <Option v-for="item in dictMap['INJ-000001']" :value="item.codingCodeId"
                                    :key="item.codingCodeId">{{ item.codingName }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="事故时间：" prop="content">
                        <DatePicker class="query-form-el" v-model="dataToQuery.dateRange" format="yyyy-MM-dd"
                                    type="daterange" placement="bottom-end" placeholder="请选择查询时间段"
                                    @on-change="onSelectQueryDateRange"></DatePicker>
                    </FormItem>
                </Col>
                <Col span="8">
                    <Button @click="switchQuery(false, 88)" class="ivu-btn-switch" type="text">收起∧</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
            </Row>
            <Row class="query-form">
                <Col span="24">
                    <Button size="large" class="ivu-btn-add" icon="md-add" @click="addInfo">新增</Button>
                    <Button type="primary" class="ivu-btn-add" icon="md-cloud-download" @click="exportForm">导出
                    </Button>
                </Col>
            </Row>
        </Form>
        <Table ref='table' :height="tableHeight" no-data-text="没有查询到相关数据!" @on-selection-change='getSelectRows'
        @on-sort-change="sortChange" :loading='pageStatus.loading'
               border :columns="columns1" :data="dataTable">
        </Table>
        <Row style="margin-right:10px;">
            <Col span="24">
                <Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize"
                    @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
                    show-total show-sizer show-elevator/>
            </Col>
        </Row>
        <Modal title="月度工伤报表" :transfer=false :mask-closable="false" v-model="dialogShow" v-if="dataToView && dialogShow" :width=800
               :styles="{height:'686px'}" class-name='limit-height-dialog'>
            <Row>
                <Col span="24">
                    <Form ref="dialogForm" :class="mode === 'view'?'modal-view-detail':'rpt-form'" :show-message="false"
                          :model="dataToView" :rules="mode === 'view'?{} :ruleCustom"
                          :label-position="mode === 'view'?'right':'top'" :label-width="mode === 'view'?160:null">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='企业名称：' prop='companyId'>
                                    <div v-if="mode === 'view'">{{dataToView.companyName}}</div>
                                    <cascader-dom v-else ref='orgCascader' @setOrgInfo='setCompanyId'
                                                  @setOrgname="setCompanyName" :orgTree="true"
                                                  :currentOrgId="dataToView.companyId"
                                                  :setCurrentName="{label:dataToView.companyName,value:dataToView.companyId}"></cascader-dom>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='所在地：' prop='companyAddress'>
                                    <div v-if="mode === 'view'">{{areaCodeToAreaName(dataToView.companyAddress)}}</div>
                                    <Cascader v-else :data="tempAreaTree" v-model="dataToView.companyAddressArr" change-on-select :transfer="true"
                                              :load-data="areaTreeLoadData" :render-format="labels=>labels.join('·')"  :clearable='false'
                                              @on-change="(value,selectedData)=>{$set(dataToView,'companyAddress',value.join(','))}"></Cascader>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='伤亡人员姓名：' prop='victimName'>
                                    <div v-if="mode === 'view'">{{dataToView.victimName}}</div>
                                    <Input v-else type='text' v-model='dataToView.victimName' :readonly="true">
                                        <Button slot="append" @click="openForSelect" icon="ios-search"></Button>
                                    </Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='性别：' prop='gender'>
                                    <div v-if="mode === 'view'">{{dataToView.gender}}</div>
                                    <Select v-else v-model='dataToView.gender' class='query-form-el'>
                                        <Option value="男">男</Option>
                                        <Option value="女">女</Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='身份证号：' prop='idCard'>
                                    <div v-if="mode === 'view'">{{dataToView.idCard}}</div>
                                    <Input v-else type='text' v-model='dataToView.idCard'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='年龄：' prop='age'>
                                    <div v-if="mode === 'view'">{{dataToView.age}}</div>
                                    <InputNumber v-else class="w" v-model='dataToView.age'></InputNumber>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='所在岗位（工种）：' prop='jobTypeId'>
                                    <div v-if="mode === 'view'">{{dataToView.jobTypeId}}</div>
                                    <Input v-else type='text' v-model='dataToView.jobTypeId'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='就业类型：' prop='jobType'>
                                    <div v-if="mode === 'view'">
                                        {{this.dictMap['MEM-000001'][dataToView.jobType] && this.dictMap['MEM-000001'][dataToView.jobType].codingName}}
                                    </div>
                                    <Select v-else class='w' placeholder="请选择就业类型" type='text'
                                            v-model='dataToView.jobType'>
                                        <Option v-for="item in dictMap['MEM-000001']" :value="item.codingCodeId"
                                                :key="item.codingCodeId">{{ item.codingName }}
                                        </Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='事故时间：' prop='accDate'>
                                    <div v-if="mode === 'view'">{{renderViewDate(dataToView.accDate)}}</div>
                                    <DatePicker v-else type="date" placeholder="请选择事故时间" class='w'
                                                v-model='dataToView.accDate' :options="options"
										editable='false'></DatePicker>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='事故类别：' prop='accType'>
                                    <div v-if="mode === 'view'">
                                        {{this.dictMap['ACC-000001'][dataToView.accType] && this.dictMap['ACC-000001'][dataToView.accType].codingName}}
                                    </div>
                                    <Select v-else class='w' placeholder="请选择事故类别" type='text'
                                            v-model='dataToView.accType'>
                                        <Option v-for="item in dictMap['ACC-000001']" :value="item.codingCodeId"
                                                :key="item.codingCodeId">{{ item.codingName }}
                                        </Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='伤残等级：' prop='injuryLevel'>
                                    <div v-if="mode === 'view'">
                                        {{this.dictMap['INJ-000001'][dataToView.injuryLevel] && this.dictMap['INJ-000001'][dataToView.injuryLevel].codingName}}
                                    </div>
                                    <Select v-else class='w' placeholder="请选择伤残等级" type='text'
                                            v-model='dataToView.injuryLevel'>
                                        <Option v-for="item in dictMap['INJ-000001']" :value="item.codingCodeId"
                                                :key="item.codingCodeId">{{ item.codingName }}
                                        </Option>
                                    </Select>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='伤害程度：' prop='injuryDegree'>
                                    <div v-if="mode === 'view'">
                                        {{this.dictMap['1000001019'][dataToView.injuryDegree] && this.dictMap['1000001019'][dataToView.injuryDegree].codingName}}
                                    </div>
                                    <Select v-else class='w' placeholder="请选择伤害程度" type='text'
                                            v-model='dataToView.injuryDegree'>
                                        <Option v-for="item in dictMap['1000001019']" :value="item.codingCodeId"
                                                :key="item.codingCodeId">{{ item.codingName }}
                                        </Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='歇工期限（日）：' prop='furlough'>
                                    <div v-if="mode === 'view'">{{dataToView.furlough}}</div>
                                    <InputNumber v-else class="w" v-model='dataToView.furlough' :min="0"></InputNumber>
                                </FormItem>
                            </Col>
                        </Row>
                        <!-- <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='填表人：' prop='registrant'>
                                    <div v-if="mode === 'view'">{{dataToView.createUserName}}</div>
                                    <Input v-else type='text' v-model='dataToView.registrant' readonly></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='填表时间：' prop='registTime'>
                                    <div v-if="mode === 'view'">{{renderViewDate(dataToView.createDate)}}</div>
                                    <DatePicker v-else type="date" placeholder="请选择日期" class="query-form-el"
                                                v-model='dataToView.registTime' readonly></DatePicker>
                                </FormItem>
                            </Col>
                        </Row> -->
						<Row type="flex" justify="space-around" class="code-row-bg">
							<Col span="11">
							<FormItem label='填表人：' prop='registrant'>
								<div v-if="mode === 'view'">{{dataToView.createUserName}}</div>
								<Input v-if="mode === 'add'" type='text' v-model='dataToView.registrant' readonly></Input>
								<Input v-if="mode === 'edit'" type='text' v-model='dataToView.createUserName' readonly></Input>
							</FormItem>
							</Col>
							<Col span="11">
							<FormItem label='填表时间：' prop='registTime'>
								<div v-if="mode === 'view'">{{renderViewDate(dataToView.createDate)}}</div>
								<DatePicker v-if="mode === 'add'" type="date" placeholder="请选择日期" class="w" v-model='dataToView.registTime'
									readonly></DatePicker>
								<DatePicker v-if="mode === 'edit'" type="date" placeholder="请选择日期" class="w" v-model='dataToView.createDate'
									readonly></DatePicker>
							</FormItem>
							</Col>
						</Row>
						<Row type="flex" justify="space-around" class="code-row-bg">
							<Col span="11">
							<FormItem label='填表人电话：' prop='createMobile'>
								<div v-if="mode === 'view'">{{dataToView.createMobile}}</div>
								<Input v-if="mode === 'add'" type='text' v-model='dataToView.createMobile'></Input>
								<Input v-if="mode === 'edit'" type='text' v-model='dataToView.createMobile' :readonly="this.currentUser.userId === dataToView.createUserId ? false : 'readonly'"></Input>
							</FormItem>
							</Col>
							<Col span="11">
							</Col>
						</Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='备注：' prop='notes'>
                                    <div v-if="mode === 'view'">{{dataToView.notes}}</div>
                                    <Input v-else type='textarea' v-model='dataToView.notes'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='工伤事故概述：' prop='notes'>
                                    <div v-if="mode === 'view'">{{dataToView.overview}}</div>
                                    <Input v-else type='textarea' v-model='dataToView.overview'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>
            <div slot="footer">
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-save' @click="submit('dialogForm')">确定
                </Button>
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-cancel' @click="handleCancel">取消</Button>
                <Button v-if="mode === 'view'" class='ivu-btn-save' @click="dialogShow=false">关闭</Button>
            </div>
        </Modal>
        <Modal title="事故简报" :transfer=false footer-hide v-model="briefingList"  :width=900>
            <briefingSelect  @getSelectData="getSelectData"  >
            </briefingSelect>
        </Modal>
    </Layout>
</template>

<script>
import {Api} from '@/api/index.js'
import {sessionStorage} from '@/common/cacheUtils.js';
import {mapState} from 'vuex'
import pageCommonFunction from '@/components/pageCommonFunction.js'
import briefingSelect from '../../../safe/accident/monthly/briefingSelect.vue'

var cascaderDom = () => import('@/components/cascader-dom.vue');

export default {
        components: {
            cascaderDom,briefingSelect
        },
		computed:{
			...mapState('trhg', {
				areaMap: state => state.area.areaMap?state.area.areaMap:[],
                areaTreeMap: state => state.area.areaTreeMap?state.area.areaTreeMap:{},
			}),
		},
        data() {
            return {
                ...this.createCommonDataField(),
                briefingList:false,
				options: {
				    disabledDate (date) {
				        return date && date.valueOf() >= new Date();
				    }
				},
                columns1: [
                    {title: '序号', width: 80, fixed: 'left', align: 'center', render: this.indexColumnsRender},
                    // { key:'perfAssessNum',title: '绩效考核责任书编号',  align: 'center', width: 100},
                    {key: 'companyName', fixed: 'left',title: '企业名称', align: 'center', width: 240},
                    {key: 'companyAddress', title: '所在地', align: 'center', width: 120, render: this.renderCellArea},
                    {key: 'victimName', title: '伤亡人员姓名', align: 'center', width: 120},
                    {key: 'gender', title: '性别', align: 'center', width: 70},
                    {key: 'age', title: '年龄', align: 'center', width: 70},
                    {key: 'idCard', title: '身份证号', align: 'center', width: 180},
                    {key: 'jobTypeId', title: '所在岗位（工种）', align: 'center', width: 160},
                    {
                        key: 'jobType', title: '就业类型', align: 'center', width: 100, render: (h, params) => {
                            return h('span', (this.dictMap['MEM-000001'] &&  this.dictMap['MEM-000001'][params.row.jobType] && this.dictMap['MEM-000001'][params.row.jobType].codingName))
                        }
                    },
                    {key: 'accDate', title: '事故时间', align: 'center', sortable: "custom", width: 100, render: this.renderCellDate},
                    {
                        key: 'accType', title: '事故类别', align: 'center', width: 90, render: (h, params) => {
                            return h('span', (this.dictMap['ACC-000001'] &&  this.dictMap['ACC-000001'][params.row.accType] && this.dictMap['ACC-000001'][params.row.accType].codingName))
                        }
                    },
                    {
                        key: 'injuryLevel', title: '伤残等级', align: 'center', width: 90, render: (h, params) => {
                            return h('span', (this.dictMap['INJ-000001'] &&  this.dictMap['INJ-000001'][params.row.injuryLevel] && this.dictMap['INJ-000001'][params.row.injuryLevel].codingName))
                        }
                    },
                    {
                        key: 'injuryDegree', title: '伤害程度', align: 'center', width: 190, render: (h, params) => {
                            return h('span', (this.dictMap['1000001019'] &&  this.dictMap['1000001019'][params.row.injuryDegree] && this.dictMap['1000001019'][params.row.injuryDegree].codingName))
                        }
                    },
                    {key: 'furlough', title: '歇工期限（日）', align: 'center', width: 130},
                    { key:'overview', title: '工伤事故概述',  align: 'center', width: 180, tooltip:true},
                    { key:'notes', title: '备注',  align: 'center', width: 180, tooltip:true},
                    this.getActionColumns()
                ],
                ruleCustom: {
                    // perfAssessNum: [ { required: true, message: '请填写绩效考核责任书编号', trigger: 'change' } ],
                    companyId: [{required: true, message: '请填写企业名称', trigger: 'change'}],
                    companyAddress: [{required: true, message: '请填写所在地', trigger: 'change'}],
                    victimName: [{required: true, message: '请填写伤亡人员姓名', trigger: 'change'}],
                    gender: [{required: true, message: '请填写性别', trigger: 'change'}],
                    // idCard: [
                    //     {required: true, message: '请填写身份证号', trigger: 'change'},
                    //     {validator: this.idCardValidator, trigger: 'change'}
                    // ],
                   /* age: [
                        { required: true, message: '请填写年龄', trigger: 'change' ,type: "number"},
                        {
                            pattern: /^(0|[1-9][0-9]*)(\.\d+){0,1}$/,
                            message: '年龄必须为数字',
                            trigger: 'change',
                            type: 'number'
                        }
                    ],*/
                    age: [{
                        validator: (rule, value, callback) => {
                            if (value == null || value == '' || value == undefined) {
                                callback(' ')
                            } else {
                                callback()
                            }
                        },
                        required: true,
                        trigger: 'change'
                    }],
                    position: [{required: true, message: '请填写绩效考核责任书编号', trigger: 'change'}],
                    // jobTypeId: [{required: true, message: '请填写所在岗位（工种）', trigger: 'change'}],
                    jobType: [{required: true, message: '请填写就业类型', trigger: 'change'}],
                    accDate: [{type: 'date', required: true, message: '请填写事故时间', trigger: 'change'}],
                    accType: [{required: true, message: '请填写事故类别', trigger: 'change'}],
                    injuryLevel: [{required: true, message: '请填写伤害程度', trigger: 'change'}],
                    furlough: [
                        { required: true, message: '请填写歇工期限（日）', trigger: 'change' ,type: "number"},
                        {
                            pattern: /^(0|[1-9][0-9]*)(\.\d+){0,1}$/,
                            message: '歇工期限必须为数字',
                            trigger: 'change',
                            type: 'number'
                        }
                    ],
					createMobile: [{
						pattern: /^((0\d{2,3}-\d{7,8})|(1[123456789]\d{9}))$/,
						required: true,
						message: '请填写填报人电话',
						trigger: 'change'
					}],
                    // notes: [ { required: true, message: '请填写备注', trigger: 'change' } ],
                    // rptPeroid: [ { type:'date', required: true, message: '请填写月份', trigger: 'change' } ],
                },
                tableHeight: 10,
                dictMap: {},
                // api
                queryUrl: Api.querySafeRptInjury,
                exportUrl: Api.exportSafeRptInjury,
                deleteUrl: Api.deleteSafeRptInjury,
                bthDeleteUrl: Api.batchDeleteSafeRptInjury,
                getUrl: Api.getSafeRptInjury,
                updateUrl: Api.updateSafeRptInjury,
                saveUrl: Api.saveSafeRptInjury,
            }
        },
        async mounted() {
            this.setTableHeight();
            this.pageStatus.baseLoading = true
            await this.$http.get(Api.queryDictBycode + "INJ-000001,1000001019,MEM-000001,ACC-000001", {}).then((res) => {
                this.dictMap = {
                    'ACC-000001': this.dictListToMap(res.data.data['ACC-000001']),
                    'INJ-000001': this.dictListToMap(res.data.data['INJ-000001']),
                    '1000001019': this.dictListToMap(res.data.data['1000001019']),
                    'MEM-000001': this.dictListToMap(res.data.data['MEM-000001'])
                }
            }).catch(e => {
                this.$Message.error("数据字典获取失败")
            });
			await this.$store.dispatch('trhg/area/query', {scope:this}, { root: true })
			this.pageStatus.baseLoading = false
            this.query();
            this.tempAreaTree = this.areaTreeMap['0']
        },
        methods: {
            ...pageCommonFunction,
            createEmptyDataToAdd() {
                return {
                    furlough: '',
                    age: '',
                    companyAddressArr: [],
					createMobile: sessionStorage('userId').getObject('userId').mobileNumber,
                }
            },
            beforeEditDialogOpen(data) {
                if(data.row.companyAddress){
                    data.row.companyAddressArr = data.row.companyAddress.split(',')
                    data.row.companyAddressName = this.areaCodeToAreaName(data.row.companyAddress)
                }
            },
            async afterDataToViewInit(data) {
                if (data && data.companyAddress) {
                    let companyAddressArr = data.companyAddress.split(',')
                    this.tempAreaTree = []
                    setTimeout(() => {
                        this.tempAreaTree = this.addressEditArr(this.areaTreeMap,companyAddressArr)
                    }, 100)
                }
            },
            deleteData(params) {
                this.deleteDateAjax(params);
            },
            openForSelect() {
                this.briefingList = true;
            },
            exportForm(){
                if (this.dataToQuery.jobTypeArrs) {
                    this.dataToQuery.jobTypes = this.arrayToInFormat(this.dataToQuery.jobTypeArrs)
                }
                if (this.dataToQuery.injuryDegreeArrs) {
                    this.dataToQuery.injuryDegrees = this.arrayToInFormat(this.dataToQuery.injuryDegreeArrs)
                }
                if (this.dataToQuery.accTypeArrs) {
                    this.dataToQuery.accTypes = this.arrayToInFormat(this.dataToQuery.accTypeArrs)
                }
                if (this.dataToQuery.injuryLevelArrs) {
                    this.dataToQuery.injuryLevels = this.arrayToInFormat(this.dataToQuery.injuryLevelArrs)
                }
                this.exportFormSubmit()
            },
            query() {
                if (this.dataToQuery.jobTypeArrs) {
                    this.dataToQuery.jobTypes = this.arrayToInFormat(this.dataToQuery.jobTypeArrs)
                }
                if (this.dataToQuery.injuryDegreeArrs) {
                    this.dataToQuery.injuryDegrees = this.arrayToInFormat(this.dataToQuery.injuryDegreeArrs)
                }
                if (this.dataToQuery.accTypeArrs) {
                    this.dataToQuery.accTypes = this.arrayToInFormat(this.dataToQuery.accTypeArrs)
                }
                if (this.dataToQuery.injuryLevelArrs) {
                    this.dataToQuery.injuryLevels = this.arrayToInFormat(this.dataToQuery.injuryLevelArrs)
                }
                this.queryAjax();
            },
            submit(name) {
                this.$set(this.dataToView,'companyAddress',this.dataToView.companyAddressArr.join(','))
                this.submitAjax(name);
            },
            getSelectData(row) {
                this.dataToView.briefId = row.briefId;
                this.dataToView.victimName = row.victim;
                this.dataToView.gender = row.gender === '0'?'男':'女';
                this.dataToView.age = row.age;
                this.dataToView.jobTypeId = row.position;
                this.dataToView.jobType = row.membershipId;
                this.dataToView.accDate = row.sartDate;
                this.dataToView.accType = row.accTypeId;
                this.dataToView.injuryDegree = row.injuryLevelId;
                this.dataToView.furlough = row.daysWork;
                this.dataToView.injuryLevel = 'INJ-000001000000011';
                this.briefingList = false;
            }
        },
        watch: {},
    }
</script>

<style lang='css' scoped>
    .rpt-form {
    }

    .query-form-el{
      width: 100%;
    }



    /deep/ .rpt-form .ivu-form-item .ivu-form-item-error-tip {
        font-size: 12px;
    }
</style>
